﻿namespace Medical.Api.Read.Dto.RBAC
{
    public class LoginDto
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone { get; set; }
        /// <summary>
        /// 用户Id
        /// </summary>
        public long UserId { get; set; }
        /// <summary>
        /// 用户所有角色
        /// </summary>
        public List<RoleDto> Roles { get; set; }
        public string Token { get; set; }
    }

    /// <summary>
    /// 角色DTO，包含权限列表
    /// </summary>
    public class RoleDto
    {
        public long RoleId { get; set; }
        public string RoleName { get; set; }
        public string RoleDesc { get; set; }
        public List<PermissionDto> Permissions { get; set; }
    }

    /// <summary>
    /// 权限DTO
    /// </summary>
    public class PermissionDto
    {
        public PermissionDto()
        {
        }

        public long PermissionId { get; set; }
        public string PermissionName { get; set; }
        public string PermissionUrl { get; set; }
        public long ParentId { get; set; } // 新增：权限的上级Id
    }
}
